package com.example.dependencyscanner.model;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 漏洞信息模型
 * 
 
 */
public class Vulnerability {
    
    @JsonProperty("groupId")
    private String groupId;
    
    @JsonProperty("artifactId")
    private String artifactId;
    
    @JsonProperty("vulnerableVersions")
    private String vulnerableVersions;
    
    @JsonProperty("safeVersion")
    private String safeVersion;
    
    @JsonProperty("cve")
    private String cve;
    
    @JsonProperty("description")
    private String description;
    
    @JsonProperty("severity")
    private String severity;
    
    @JsonProperty("reference")
    private String reference;
    
    public Vulnerability() {}
    
    public Vulnerability(String groupId, String artifactId, String vulnerableVersions, 
                        String safeVersion, String cve, String description, 
                        String severity, String reference) {
        this.groupId = groupId;
        this.artifactId = artifactId;
        this.vulnerableVersions = vulnerableVersions;
        this.safeVersion = safeVersion;
        this.cve = cve;
        this.description = description;
        this.severity = severity;
        this.reference = reference;
    }
    
    // Getters and Setters
    public String getGroupId() {
        return groupId;
    }
    
    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }
    
    public String getArtifactId() {
        return artifactId;
    }
    
    public void setArtifactId(String artifactId) {
        this.artifactId = artifactId;
    }
    
    public String getVulnerableVersions() {
        return vulnerableVersions;
    }
    
    public void setVulnerableVersions(String vulnerableVersions) {
        this.vulnerableVersions = vulnerableVersions;
    }
    
    public String getSafeVersion() {
        return safeVersion;
    }
    
    public void setSafeVersion(String safeVersion) {
        this.safeVersion = safeVersion;
    }
    
    public String getCve() {
        return cve;
    }
    
    public void setCve(String cve) {
        this.cve = cve;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public String getSeverity() {
        return severity;
    }
    
    public void setSeverity(String severity) {
        this.severity = severity;
    }
    
    public String getReference() {
        return reference;
    }
    
    public void setReference(String reference) {
        this.reference = reference;
    }
    
    @Override
    public String toString() {
        return "Vulnerability{" +
                "groupId='" + groupId + '\'' +
                ", artifactId='" + artifactId + '\'' +
                ", vulnerableVersions='" + vulnerableVersions + '\'' +
                ", safeVersion='" + safeVersion + '\'' +
                ", cve='" + cve + '\'' +
                ", description='" + description + '\'' +
                ", severity='" + severity + '\'' +
                ", reference='" + reference + '\'' +
                '}';
    }
}